package com.dp.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;


public class MessagePropertise {
    InputStream is = null;
    Properties Props;

    public void setFile(String nFile) {
        try {
            is = getClass().getResource("/" + nFile).openStream();
            Props = new Properties();
            Props.load(is);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void CloseFile() {
        try {
            is.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

  
    public String getProperty(String SourceTxt) {
        String sql = "";

        try {
            sql = Props.getProperty(SourceTxt);
        } catch (Exception e) {
            e.printStackTrace();            
            sql = "";
        }

        return sql;
    }

  
    public Properties LoadPropertie(String vfile) {
        Properties Props = new Properties();

        try {
            InputStream is = getClass().getResource("/" + vfile).openStream();

            Props.load(is);
            is.close();
        } catch (Exception e) {
           e.printStackTrace();
        }

        return Props;
    }
}
